# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-other
pkgname=kdiagram
pkgver=3.0.1
pkgrel=0
pkgdesc="Powerful libraries (KChart, KGantt) for creating business diagrams"
arch="all !armhf"
url="https://kontact.kde.org/"
license="GPL-2.0-or-later"
depends_dev="
	qt6-qtbase-dev
	qt6-qtsvg-dev
	"
makedepends="$depends_dev
	doxygen
	extra-cmake-modules
	graphviz
	qt6-qttools-dev
	samurai
	"
checkdepends="xvfb-run"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"
_repo_url="https://invent.kde.org/graphics/kdiagram.git"
source="https://download.kde.org/stable/kdiagram/$pkgver/kdiagram-$pkgver.tar.xz"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_QCH=ON
	cmake --build build
}

check() {
	# TestDrawIntoPainter times out
	xvfb-run ctest --test-dir build --output-on-failure -E "TestDrawIntoPainter"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
767c5ba0a4dfcc8b5a5bbf1c65b30bb391537024618b29ea5d5d09da04f85e2665cad60a7477e1cebeed0606e17c992cba0af7a89c76699063bb47e741ea8e20  kdiagram-3.0.1.tar.xz
"
